<template>
  <!--保存弹框 -->
  <m-modal
    v-model="visible"
    :width="475"
    class="v-saveProject"
    mask
    :title="title"
    :showFooter="true"
    cancelText="取消"
    centerBtnText="不保存"
    okText="立即保存"
    @cancel="handleCancel"
    @ok="handleOk"
    @click-center="handleOk"
  >
    <div>
      <div class="_content">
        <div class="_title">
          <img src="statics/images/mainpage/Warning.svg">保存当前项目
        </div>
        <div class="_con">
          项目尚未保存，是否需要保存？
        </div>
      </div>
    </div>
  </m-modal>
</template>
<script>
import customModal from '../common/CustomModal';
import { Portal } from 'src/components/common/Portal.vue';

const com = {
  name: 'saveProject',
  components: {
    'm-modal': customModal,
  },
  data() {
    return {
      visible: false,
      title: '保存',
      listFlag: 'loading',
    };
  },

  computed: {},
  watch: {},
  mounted() {
    this.visible = true;
  },
  beforeCreate() {},
  beforeDestroy() {},
  methods: {
    handleOk(res) {
      this.visible = false;
      this.$emit('sure', res);
    },
    handleCancel() {
      this.visible = false;
      this.$emit('close');
    },
  },
};
export default com;
export const saveProjectModal = new Portal(com, { single: true });
</script>
<style lang="scss" scoped>
.v-saveProject {
	._content {
		padding: 16px;
		._title {
			height: 32px;
			font-size: 14px;
			font-weight: 500;
			color: rgba(0, 0, 0, 0.85);
        line-height: 32px;
			> img {
        margin-top: -4px;
        margin-right: 4px;
        line-height: 32px;
			}
		}
		._con {
			height: 53px;
			font-size: 12px;
			font-weight: 400;
			color: rgba(0, 0, 0, 0.65);
			line-height: 20px;
      padding-left: 20px;
		}
	}
}
</style>
